#!/usr/bin/env python
# -*- coding: UTF-8 -*-
"""

@author ：chenzf
@date ：2024/4/24 上午11:06 
"""
import os
# def test_os():
    # print(os.listdir("D:/software_back"))
    # print(os.path.isdir("D:/software_back"))
    # print(os.path.exists("D:/software_back"))

def get_all_file(path):
    print(f"当前执行目录{path}")
    file_list = []
    if os.path.exists(path):
        for file in os.listdir(path):
            # new_path = os.path.join(path, file)
            new_path = path + "/" + file
            if os.path.isdir(new_path) :
                file_list += get_all_file(new_path)
            else:
                file_list.append(new_path)
    else:
        print(f"指定的目录{path}不存在")
        return []
    return file_list
if __name__ == '__main__':
    # test_os()
    print(get_all_file("D:/software_back"))
